package com.xinlianshiye.im.dao;

import com.xinlianshiye.im.dao.custom.FriendApplicationDaoCustom;
import com.xinlianshiye.im.bean.FriendApplication;
import org.springframework.data.jpa.repository.JpaRepository;

public interface FriendApplicationDao extends JpaRepository<FriendApplication,Integer>, FriendApplicationDaoCustom {
    /**
     * @Author zw
     * @Description 判断申请好友是否已经申请了该好友
     * @Date 15:31 2019/8/9
     * @Param
     **/

    Boolean existsByUserIdAndTargetUserIdAndApplyState(Integer userId, Integer targetUserId, FriendApplication.ApplyStateEnum applyState);

    /**
     * @Author zw
     * @Description  删除好友申请记录
     * @Date 9:56 2019/8/30
     * @Param
     **/
    Integer deleteByUserIdAndTargetUserId(Integer userId, Integer targetUserId);
}
